﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace FlaresAtHand
{
    public static class Utils
    {
        public static String ApplicationDataPath
        {
            get
            {
                return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mobileflares");
            }
        }
        
        public static String GetDataFilePath(String filename)
        {
            return Path.Combine(ApplicationDataPath, filename); ;
        }
        
        public static String SetUpDataFile(String filename)
        {
            String datafile = GetDataFilePath(filename);
            if (!File.Exists(datafile))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(datafile));
                using (var stream = File.Create(datafile))
                {
                }
            }

            return datafile;
        }
    }
}
